import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt

# 导入加入了椒盐噪声的图像
dogsp = cv.imread("image/dogsp.jpeg")

# 导入加入了高斯噪声的图像
doggs = cv.imread("image/dogGauss.jpeg")

# 中值滤波(对椒盐噪声尤其有用)(实测：相比均值滤波，中值滤波处理椒盐噪声效果显著)
dog3 = cv.medianBlur(doggs, 5)
plt.imshow(dog3[:, :, ::-1])
plt.show()